package com.weiwei.diancan.adapter;

import android.graphics.Color;
import android.widget.LinearLayout;

import com.weiwei.diancan.R;
import com.weiwei.diancan.bean.LoginBean;

import java.util.List;

import weiwei.com.weiweilibrary.adapter.BaseQuickAdapter;
import weiwei.com.weiweilibrary.holder.BaseViewHolder;

/**
 * Created by BMW on 2016/11/28.
 */
public class ShangpinAdapter extends BaseQuickAdapter<LoginBean.MenuListBean.DishListBean.SetListBean> {
    public ShangpinAdapter( List<LoginBean.MenuListBean.DishListBean.SetListBean> data) {
        super(R.layout.item_shangpin_tou, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, LoginBean.MenuListBean.DishListBean.SetListBean item, int position) {
        LinearLayout ll_all = helper.getView(R.id.ll_all);
            ll_all.setBackgroundColor(Color.parseColor("#e9e9e9"));
            helper.setText(R.id.tv_xu,(position+1)+"");
            helper.setText(R.id.tv_name,item.getDish_name());
            helper.setText(R.id.tv_x,"x");
            helper.setText(R.id.tv_price,"¥"+item.getDish_price()+"/"+item.getDish_unit());
            helper.setText(R.id.tv_num,"1");
    }
}
